#ifndef __ITEXTURECOORDINATES_H__
#define __ITEXTURECOORDINATES_H__

#include "CTypes.h"

typedef enum StandardTextureCoordinates
{
	TC_UP_DOWN	= 0,
	TC_DOWN_UP	= 1,
	TC_LEFT_RIGHT	= 2,
	TC_RIGHT_LEFT	= 3,
	TC_FIX_LENGHT	= 0xffffffff,
}StandardTextureCoordinates;

class ITextureCoordinates
{
protected:
	vPos Coordinates[2*4];
public:
	ITextureCoordinates(StandardTextureCoordinates tc=TC_UP_DOWN)
	{
		SetTextureCoordinatesStandard(tc);
	}

	virtual ~ITextureCoordinates() {}

	void Update(ITextureCoordinates *other)
	{
		for (u32 i=0;i<2*4*sizeof(vPos);i++)
		{
			Coordinates[i] = other->Coordinates[i];
		}
	}

	inline vPos *GetCoordinates(u32 NumVector)	{	return &(Coordinates[2*NumVector]); }

	virtual void SetTextureCoordinatesStandard(StandardTextureCoordinates tc)
	{
		switch (tc)
		{
			default:
			case TC_UP_DOWN:
			{
				Coordinates[0] = 0.0;
				Coordinates[1] = 1.0;
				Coordinates[2] = 1.0;
				Coordinates[3] = 1.0;
				Coordinates[4] = 1.0;
				Coordinates[5] = 0.0;
				Coordinates[6] = 0.0;
				Coordinates[7] = 0.0;
			}
			break;

			case TC_DOWN_UP:
			{

			}
			break;

			case TC_LEFT_RIGHT:
			{

			}
			break;

			case TC_RIGHT_LEFT:
			{

			}
			break;

		}
	}

	virtual void SetTextureCoordinates(vector2dvpos &v1,vector2dvpos &v2,vector2dvpos &v3,vector2dvpos &v4)
	{
		Coordinates[0] = v1.X;
		Coordinates[1] = v1.Y;
		Coordinates[2] = v2.X;
		Coordinates[3] = v2.Y;
		Coordinates[4] = v3.X;
		Coordinates[5] = v3.Y;
		Coordinates[6] = v4.X;
		Coordinates[7] = v4.Y;
	}

	virtual void SetTextureCoordinates(vector2dvpos *tl,vector2dvpos *tr,vector2dvpos *dl,vector2dvpos *dr)
	{

	}
};

#endif
